//
//  MainActivityCell.m
//  Rabbit
//
//  Created by 阿帕 on 2018/11/4.
//  Copyright © 2018年 GCY. All rights reserved.
//

#import "FreightIndexCell.h"

@interface FreightIndexCell ()
@property (weak, nonatomic) IBOutlet UILabel *zhuangAdressLabel;
@property (weak, nonatomic) IBOutlet UILabel *xieAdressLabel;
@property (weak, nonatomic) IBOutlet UILabel *freightLabel;
@property (weak, nonatomic) IBOutlet UILabel *goodsNameLabel;
@property (weak, nonatomic) IBOutlet UIView *lineView;

@end

@implementation FreightIndexCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    _lineView.backgroundColor = BackgroundColor;
    _zhuangAdressLabel.textColor = Dark_TextColor;
    _xieAdressLabel.textColor = Dark_TextColor;
    _freightLabel.textColor = Orange_Color;
    _goodsNameLabel.textColor = Theme_ColorValue;
    _goodsNameLabel.backgroundColor = [UIColor cy_colorWithHexString:@"#E7F0FF"];
    _freightLabel.adjustsFontSizeToFitWidth = YES;
    _goodsNameLabel.adjustsFontSizeToFitWidth = YES;
    _zhuangAdressLabel.adjustsFontSizeToFitWidth = YES;
    _xieAdressLabel.adjustsFontSizeToFitWidth = YES;

}
- (void)setModel:(FreightIndexModel *)model {
    
    _model = model;

    _zhuangAdressLabel.text = model.shipperAddress;
    _xieAdressLabel.text = model.consigneeAddress;
    _freightLabel.text = CJStringWithFormat(@"%.2f元/吨", model.price);
    _goodsNameLabel.text = model.coalBigTypeName;
    
    if ([DCSpeedy isBlankString:model.coalBigTypeName] == YES) {
        _goodsNameLabel.hidden = YES;
    } else {
        _goodsNameLabel.hidden = NO;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
